CC = gcc
CFLAGS = -Wall -O3 -D_PANDORA `sdl-config --cflags`
LDFLAGS = `sdl-config --libs`
SOURCES = src/particle.c src/sandora.c
OBJECTS = $(SOURCES:.c=.o)
TARGET = sandora
PNDTARGET = $(TARGET)-0.1.2.pnd

all: $(TARGET)

$(TARGET): $(OBJECTS)
	$(CC) $(CFLAGS) $(OBJECTS) $(LDFLAGS) -o $@

.c.o:
	$(CC) -c $(CFLAGS) $< -o $@

clean:
	rm -f $(PNDTARGET) $(TARGET) $(OBJECTS)

pnd: $(TARGET)
	mkdir tmp
	cp $(TARGET) tmp
	/usr/pandora/scripts/pnd_make.sh -p $(PNDTARGET) -d tmp -x pnd/PXML.xml -i pnd/icon.png -c
	rm -rf tmp